cmake_minimum_required(VERSION 3.2)
project(snakyrun)

#set(CMAKE_CXX_STANDARD 14)

option(WITH_QT "qt" OFF)
option(WITH_TUYA "tuya iot" OFF)
set(PLAT ${ARCH})

message(STATUS "plat:${PLAT}")

if (WITH_TUYA)
	include_directories(${TUYA_PATH}/include)
	link_directories(${TUYA_PATH}/lib)
	link_directories(link_core)
	add_definitions(-DWITH_TUYA)
endif ()

if (${PLAT} STREQUAL "amd64")
	message(STATUS "amd64")
	add_definitions(-DNORMAL_PC)
endif ()

message(STATUS "CURRENT: ${CMAKE_CURRENT_SOURCE_DIR}")
message(STATUS "COMMON: ${COMMON_SRC_PATH}")
message(STATUS "TUYA: ${TUYA_PATH}")
include_directories(.)
include_directories(src)
include_directories(src/message)
include_directories(src/netprocess)
include_directories(src/http_service_debug)
include_directories(src/service_base)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/${COMMON_SRC_PATH}/common/utils)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/${COMMON_SRC_PATH}/common/funcs)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/${COMMON_SRC_PATH}/common/net)

set(BASE_FILES
		snakyrun.cpp
		)

set(COMMON_FILES
		../jklibs/common/utils/rt_print.c
		../jklibs/common/utils/rt_print.h
		../jklibs/common/funcs/CMLock.cpp
		../jklibs/common/funcs/CMLock.h
		)

add_subdirectory(src/message)
add_subdirectory(src/service_base)
add_subdirectory(src/http_service_debug)

if (WITH_TUYA)
	add_subdirectory(src/netprocess)
endif ()

add_executable(snakyrun
	${BASE_FILES}
	${COMMON_FILES}
	)

target_link_libraries(snakyrun
	pthread
	)

